#ifndef __PD_DRIVER_H__
#define __PD_DRIVER_H__

#include "main.h"


extern volatile uint8_t  Pdo_Number;
extern uint8_t Pdo_Buff[8][64];

uint8_t FUSB_Read_Reg(uint8_t addr);

uint8_t FUSB_Read_Fifo(uint8_t *buff, uint8_t len);

uint8_t FUSB_Write_Reg(uint8_t addr, uint8_t data);

uint8_t FUSB_Write_Fifo(uint8_t *buff, uint8_t len);

uint8_t FUSB_Init(uint8_t time);

void FUSB_Rd_Control(uint8_t state);

void FUSB_IRQHandler(void);

void PPS_Timer_Handler(void);
	
void FUSB_Request(uint8_t pdo_idx, uint16_t volt, uint16_t curr);

char PD_Set_Volt(uint16_t volt); // mV

#endif
